#ex7
target=int(input('target='))
array=[
[1, 4, 7, 11, 15],
[2, 5, 8, 12, 19],
[3, 6, 9, 16, 22],
[10, 13, 14, 17, 24],
[18, 21, 23, 26, 30]
]
class Solution:
    # 2-D array 
    def Find( target, array):
        if not array:
            return
        row = len(array)#行
        col = len(array[0])#列

        for i in range(row):
            for j in range(col):
                if target == array[i][j]:
                    return True

        return False
    print(Find(target,array))